$(function(){ 
$("#user_insert_btn").click(function(){
	
	var kaptcha = $("#kaptcha").val();
	if (kaptcha.length == 0) {
		alert("您没有输入验证码！");
	} else {
		
	
	var name = $("#name").val();
	var password = $("#password").val();
	var roleId = $("#roleId").val();
	$.ajax({
		url:"login",
		data:
		{name:name,password:password,roleId:roleId},
		type:"post",
		success:function(msg){
			console.log(msg);
			//100表示成功
			if (msg.code == 100) {
				window.location.href = msg.map.url;
			} else {
				 $('#prompt').text(msg.map.errMsg);  
			}
		 },
		 error:function(XMLHttpRequest, textStatus, errorThrown) {
			 alert(XMLHttpRequest.status);
			 alert(XMLHttpRequest.readyState);
			 alert(textStatus);
		 }
		
		}); 
	
	}	
	
});
}); 
$(function(){
	
});